#include "RemovePieceNetworkEvent.h"
#include "Well.h"

RemovePieceNetworkEvent::RemovePieceNetworkEvent(long pieceId)
{
    message.header.code = NetworkEvent::SERVER_REMOVE_PIECE;
    message.header.sizeOfData = sizeof(message) - sizeof(message.header);
    message.data.pieceId = pieceId;
}

RemovePieceNetworkEvent::RemovePieceNetworkEvent(const Header& header, const Data& data)
{
    message.header = header;
    message.data = data;
}

RemovePieceNetworkEvent::~RemovePieceNetworkEvent()
{
}

void* RemovePieceNetworkEvent::getMessageBlob()
{
    return &message;
}

size_t RemovePieceNetworkEvent::getMessageBlobSize()
{
    return sizeof(message);
}

void RemovePieceNetworkEvent::visitWell(Well* well) const
{
    well->handleRemovePieceEvent(message.data.pieceId);
}
